package com.aptech.dao;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HibernateUtil1 {
	private static final Logger log = LoggerFactory.getLogger(HibernateUtil1.class);

	private static SessionFactory sessionFactory;
	
	private HibernateUtil1(){
		
	}
	
	static{
		try{
			sessionFactory = new Configuration().configure().buildSessionFactory();
		}catch(Throwable e){
				log.error("获取sessionfactoey异常,异常是:",e);	
				}
	}
	public static synchronized SessionFactory getSessionFactory(){
			return sessionFactory;
	}

}
